package com.ychen.goodscenter.dao;

import com.ychen.goodscenter.entity.GoodsInfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsInfoMapper {
    int deleteByPrimaryKey(Long id);

    int deleteAll();

    int batchInsert(List<GoodsInfo> list);


    int insertSelective(GoodsInfo row);

    GoodsInfo selectByPrimaryKey(Long id, Boolean... forUpdate);

    int updateByPrimaryKeySelective(GoodsInfo row);

    int updateByPrimaryKey(GoodsInfo row);

    //扣减库存
    void reduceStock(Long id, Integer tradeNumber);

    //回滚库存
    void rollbackStock(Long id, Integer tradeNumber);

}